package com.yungu.swift.assets.driver.service.impl;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.dubbo.config.annotation.Service;
import com.yungu.swift.assets.driver.dao.DriverSignLogMapper;
import com.yungu.swift.assets.driver.model.dto.DriverSignLogDto;
import com.yungu.swift.assets.driver.model.vo.DriverSignLogVo;
import com.yungu.swift.assets.driver.service.DriverSignLogService;
import com.yungu.swift.base.ResponseData;
import com.yungu.swift.base.mapper.IMapper;
import com.yungu.swift.base.service.impl.BaseServiceImpl;
import com.yungu.swift.order.service.OrderFareService;
import com.yungu.swift.utils.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Map;


/**
 * DriverSignLogServiceImpl
 **/

@Service
public class DriverSignLogServiceImpl extends BaseServiceImpl<DriverSignLogDto> implements DriverSignLogService {

    @Autowired
    private DriverSignLogMapper driverSignLogMapper;

    @Reference
    private OrderFareService orderFareService;

    @Override
    protected IMapper<DriverSignLogDto> getMapper() {
        return driverSignLogMapper;
    }

    @Override
    public ResponseData<DriverSignLogVo> findExaminationList(String uuid, String startTime, String endTime) {
        return orderFareService.findExaminationList(uuid, startTime, endTime);
    }

    /**
     * 后台-订单-乘客订单详情-司机信息-获取服务里程数和收入
     *
     * @param driverUuid
     * @return
     */
    @Override
    public ResponseData<Map<String, Object>> getCountInfo(String driverUuid) {
        return ResponseData.buildSuccessResponse(this.driverSignLogMapper.getCountInfo(MapUtils.build("driverUuid", driverUuid)));
    }

}